package com.jeff.tianti.cms.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jeff.tianti.common.entity.BaseEntity;

import javax.persistence.*;

@Entity
@Table(name = "advertising_encyclopedia")//广告百科专页/广告百科内容管理表
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public class AdvertisingEncyclopedia extends BaseEntity {
    private static final long serialVersionUID = 7791777485266374370L;
    public static final String TYPE_ZERO = "0";//0->问答类型
    public static final String TYPE_ONE = "1";// 1->百科类型

    @Column(name = "title")
    private String title;//标题
    @Column(name = "img_url")
    private String imgUrl;//图片url
    @Column(name = "img_file")
    private String imgFile;//图片file路径
    @Column(name = "content")
    private String content;//内容
    @Column(name = "type")
    private String type;//0->问答类型     1->百科类型
    private AdvertisingEncyclopediaType advertisingEncyclopediaType;//advertising_encyclopedia_type表主键id
    private String cmsId;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "cms_id")
    public String getCmsId() {
        return cmsId;
    }

    public void setCmsId(String cmsId) {
        this.cmsId = cmsId;
    }

    @ManyToOne
    @JoinColumn(name = "cms_id", insertable = false, updatable = false)
    public AdvertisingEncyclopediaType getAdvertisingEncyclopediaType() {
        return advertisingEncyclopediaType;
    }

    public void setAdvertisingEncyclopediaType(AdvertisingEncyclopediaType advertisingEncyclopediaType) {
        this.advertisingEncyclopediaType = advertisingEncyclopediaType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getImgFile() {
        return imgFile;
    }

    public void setImgFile(String imgFile) {
        this.imgFile = imgFile;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
